import EntityTypes from "../Constants/EntityTypes";
import Effects from "../Constants/Effects";
import IAsset from "../Interfaces/IAsset";
import C from "../Configs/Config";

/**
 * 物件配表结构
 */

// 物件表结构
export default class MapAssetStruct implements IAsset {
    readonly dropdown: number;
    readonly id: number;
    readonly name: string;
    readonly asset: string;
    readonly effect: Effects;
    readonly sound: string;
    type: EntityTypes;
    enumber: number;

    constructor(mas: MapAssetStruct) {
        let assetC = C().MapAsset.GetAssetConfig(mas.id);
        this.id = mas.id;
        this.name = mas.name;
        this.asset = mas.asset;
        this.type = assetC.type;
        this.effect = assetC.effect;
        this.enumber = mas.enumber < assetC.enumber ? assetC.enumber : mas.enumber;
        this.dropdown = assetC.dropdown;
        this.sound = assetC.sound;
    }
}